<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>编辑字段</title>
    <hdjs />
    <js file= '__PUBLIC__/js/mod.base.js,__PUBLIC__/js/mod.field.js' />
    <css file= '__PUBLIC__/css/mod.base.css' />
</head>
<body>
    <form action="" method="post" class="hd-form" name="form" >
        <div class="hd-menu-list">
            <ul>
		        <li>
		            <a href="{:U('Model/index')}">模型列表</a>
		        </li>
                <li>
                    <a href="{:U('ModelField/index',array('mid'=>$_GET['mid']))}">字段列表</a>
                </li>
                <li class="active">
                    <a href="javascript:;">编辑字段</a>
                </li>
            </ul>
        </div>
        <div class="hd-title-header">温馨提示</div>
        <div class="help">
            <ul>
                <li>
                 {$model['remark']} 请谨慎修改！
                </li>
            </ul>
        </div>
        <div class="hd-title-header">编辑字段</div>
        <div class="right_content">
            <table class="hd-table hd-table-form">
                <tbody>
                    <tr>
                        <th class="hd-w100">
                            字段说明
                            <span class="star">*</span>
                        </th>
                        <td>
                            <input type="text" name="title" class="hd-w200" value="{$data.title}"></td>
                    </tr>
                    <tr>
                        <th>
                            字段名称
                            <span class="star">*</span>
                        </th>
                        <td>
                            <input type="text" name="fname" class="hd-w200" value="{$data.fname}"></td>
                    </tr>
                    <tr>
                        <th>
                            排序
                            <span class="star">*</span>
                        </th>
                        <td>
                            <input type="text" name="sort" class="hd-w200"  value="{$data.sort}"></td>
                    </tr>
                    <tr>
                        <th>
                            字段类型
                            <span class="star">*</span>
                        </th>
                        <td>
                        <!-- 1 文本 ，2多行文本 ，3 编辑器 4简单编辑器 ，5 单选框 ，6下拉框，7多选框 ，8文件上传框，9图片上传框 ， 10地区联动 -->
                           <select name="show_type" >
                                <option value="1" <if condition="$data['show_type'] eq '1'">selected='selected'</if>>文本</option>
                                <option value="2" <if condition="$data['show_type'] eq '2'">selected='selected'</if>>多行文本</option>
                                <option value="3" <if condition="$data['show_type'] eq '3'">selected='selected'</if>>编辑器</option>
                                <option value="4" <if condition="$data['show_type'] eq '4'">selected='selected'</if>>简单编辑器</option>
                                <option value="5" <if condition="$data['show_type'] eq '5'">selected='selected'</if>>单选框</option>
                                <option value="6" <if condition="$data['show_type'] eq '6'">selected='selected'</if>>下拉框</option>
                                <option value="7" <if condition="$data['show_type'] eq '7'">selected='selected'</if>>多选框</option>
                                <option value="8" <if condition="$data['show_type'] eq '8'">selected='selected'</if>>文件上传框</option>
                                <option value="9" <if condition="$data['show_type'] eq '9'">selected='selected'</if>>图片上传框</option>
                                <!-- <option value="10">地区联动</option> -->
                            </select></td>
                    </tr>
                    <tr>
                        <th>
                            字段验证
                            <span class="star">*</span>
                        </th>
                        <td>
                           <input type="text" name="validate" class="hd-w200"  value="{$field.validate}">
                           <select id="validate">
								<option value="">验证规则</option>
								<option value="/^\d+$/">数字</option>
								<option value="/^([a-zA-Z0-9_\-\.])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/i">邮箱</option>
								<option value="/^\d{11}$/">手机</option>
								<option value="/(?:\(\d{3,4}\)|\d{3,4}-?)\d{8}/">固定电话</option>
							</select></td>
                    </tr>
                    <tr>
                        <th>
                            错误提示
                      		
                        </th>
                        <td>
                            <input type="text" name="error" class="hd-w200" value="{$data.error}"></td>
                    </tr>
                    <tr>
                        <th>
                            是否必填
                            <span class="star">*</span>
                        </th>
                        <td>
                           <label><input type="radio" value="1" <if condition="$data['require']">checked="checked"</if> name='require'/> 是</label>
                           <label><input type="radio" value="0" <if condition="!$data['require']">checked="checked"</if> name='require' /> 否</label>
                        </td>
                    </tr>
                    
                    <tr>
                        <th>
                            是否禁用
                            <span class="star">*</span>
                        </th>
                        <td>
                           <label><input type="radio" value="1" name='is_disabled' <if condition="$data['is_disabled']">checked="checked"</if> name='require'/> 是</label>
                            <label><input type="radio" value="0" name='is_disabled' <if condition="!$data['is_disabled']">checked="checked"</if> name='require'/> 否</label>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            是否列表显示
                            <span class="star">*</span>
                        </th>
                        <td>
                            <label><input type="radio" value="1" name='show_lists' <if condition="$data['show_lists']">checked="checked"</if> /> 是</label>
                            <label><input type="radio" value="0" name='show_lists' <if condition="!$data['show_lists']">checked="checked"</if> /> 否</label>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            默认值
                      		
                        </th>
                        <td>
                           <table class='single'>
                           	<tr>
                                <td>
                                    <input type="text" name="value[][{$data.field_value.0.fv_id}]" class='hd-w200' value="{$data.field_value.0.field_value}" />
                                </td>
                            </tr>
                           </table>

                           <table class='multiple'>
                               	<foreach name='data.field_value' item='v'>
                                <tr>
                                    <td>
                                        <input type="text" name="value[][{$v.fv_id}]" class='hd-w200' value="{$v.field_value}"/>
                                        <if condition='!$key'>
                                        <span class='hand plus'>[+]</span>
                                        <else />
                                        <span class='hand minus'>[-]</span>
                                        </if>
                                    </td>
                                </tr>
                                </foreach>
                           </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <input type="hidden" name="mid" value="{$Think.get.mid}">
        <input type="hidden" name="fid" value="{$Think.get.fid}">
        <input type="submit" value="编辑" class="hd-btn hd-btn-sm">
        <input type="button" value="返回" class="hd-btn hd-btn-sm" onclick="location.href='{:U('Field/index',array('mid'=>$_GET['mid']))}'"> 
        </form>

</body>
</html>